#pragma once

#include <QWidget>
#include "ui_TransformOperationWidget.h"
#include "modelSoft.h"
#include <transformFeature.h>

QT_BEGIN_NAMESPACE
namespace Ui { class TransformOperationWidgetClass; };
QT_END_NAMESPACE

class TransformOperationWidget : public QWidget
{
	Q_OBJECT

public:
	TransformOperationWidget(modelSoft* myModelSoft, QWidget *parent = nullptr);
	~TransformOperationWidget();

protected:
	void receiveSelectedShape(const TopoDS_Shape& selectedShape, Handle(QIVtkSelectionPipeline) pipeline);
	void receiveShapePipeline(Handle(QIVtkSelectionPipeline) pipeline);
	void OnClickConfirm();
	void OnClickSelectRotationEdge();
	void OnSelTarget();
	void OnCancelSelTarget();
	void createConnection();
	virtual void closeEvent(QCloseEvent* event) override;


private:
	Ui::TransformOperationWidgetClass *ui;
	bool confirmCreated = false;
	bool targetReceive = false;
	bool rotateReceive = false;
	Handle(QIVtkSelectionPipeline) m_selectedPipelineTarget;
	Handle(QIVtkSelectionPipeline) m_resultPipeline;
	TransformFeature* transformFeature;
	gp_Pnt rotateStart = gp_Pnt(0,0,0);
	gp_Pnt rotateEnd = gp_Pnt(0,0,0);
	modelSoft* myModelSoft;
	bool rotate;
	bool pan;
};
